<?php

namespace Wilead\IArtistBundle\Helper;

use Wilead\IArtistBundle\Entity\User;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of UserHelper
 *
 * @author jack
 */
class UserHelper {

    private $user;

    public function __construct(User $user) {
        $this->user = $user;
    }

    public function isMember() {
        $expiredAt = $this->user->getMemberExpiredAt();

        if ($expiredAt) {
            $now = new \DateTime;
            return $expiredAt >= $now;
        }

        return FALSE;
    }

    public function getJobCount() {
        
    }

    public function isArtist() {
        return ($this->user->getAccountType() === User::ACCOUNT_TYPE_ARTIST);
    }

    public function isOrganization() {
        return ($this->user->getAccountType() === User::ACCOUNT_TYPE_ORGANIZATION);
    }

}

?>
